unit UFPesqisaConciliacao;

interface

uses
  Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
  Dialogs, UFormPesquisa, DBCtrls, StdCtrls, Mask, ToolEdit, DB, DBTables,
  Grids, DBGrids, Buttons, ExtCtrls;

type
  TRcaonciliacao = class(TFormPesquisa)
    Data1: TDateEdit;
    Data: TLabel;
    DBLookupComboBox1: TDBLookupComboBox;
    DSConta: TDataSource;
    Label1: TLabel;
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure BtnConsultarClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Rcaonciliacao: TRcaonciliacao;

implementation

{$R *.dfm}

procedure TRcaonciliacao.FormClose(Sender: TObject;
  var Action: TCloseAction);
begin
  inherited;
  Rcaonciliacao := nil;
  action := cafree;
end;

procedure TRcaonciliacao.BtnConsultarClick(Sender: TObject);
const
  SQL= 'select * from LANCAMENTO where (LANC_DATA = %s)  and (LANC_CONTA = %s)';
begin
  //inherited;

  if QPesquisa.Active = true then
  QPesquisa.Close;

  QPesquisa.SQL.Clear;
  QPesquisa.SQL.Add(Format(SQL,[QUOTEDSTR(DATETOSTR(Data1.Date)),
                            QUOTEDSTR(DBLookupComboBox1.KeyValue)]));
  QPesquisa.Open;
end;

end.
